Golang net/rpc.NewServer(), HandleHTTP() and Accept() functions example
package net/rpc
Golang net/rpc.NewServer() function usage example
server := rpc.NewServer(nil) //<---- here !
httpServerAddr = server.Listener.Addr().String()
fmt.Println(httpServerAddr)
listen, err := net.Listen("tcp", "127.0.0.1:8080")
if err != nil {
panic(err)
}
go server.Accept(listen)
server.HandleHTTP()
References :
http://golang.org/pkg/net/rpc/#Server
Advertisement
Something interesting
Tutorials
+8.8k Golang : On lambda, anonymous, inline functions and function literals
+8.3k Golang : Count leading or ending zeros(any item of interest) example
+11k Golang : Replace a parameter's value inside a configuration file example
+15.3k nginx: [emerg] unknown directive "ssl"
+24.1k Golang : Upload to S3 with official aws-sdk-go package
+29.5k Golang : How to create new XML file ?
+15.6k Chrome : ERR_INSECURE_RESPONSE and allow Chrome browser to load insecure content
+30.6k Golang : Remove characters from string example
+5.4k How to check with curl if my website or the asset is gzipped ?
+22.6k Generate checksum for a file in Go
+15.9k Golang : Read a file line by line
+21.1k Golang : Sort and reverse sort a slice of strings